<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Site Manager</title>
        <link rel="stylesheet" type="text/css" href="<?= base_url(); ?>css/admin/reset.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="<?= base_url(); ?>css/admin/text.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="<?= base_url(); ?>css/admin/grid.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="<?= base_url(); ?>css/admin/layout.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="<?= base_url(); ?>css/admin/nav.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="<?= base_url(); ?>css/admin/custom.css" media="screen" />
        <!--[if IE 6]><link rel="stylesheet" type="text/css" href="../css/ie6.css" media="screen" /><![endif]-->
        <!--[if IE 7]><link rel="stylesheet" type="text/css" href="../css/ie.css" media="screen" /><![endif]-->
    </head>
    <body >
        <div class="container_16" >
            <?php include 'admin_header.php'; ?>
            <!-- Left Menu Panel !-->
            <?php include 'admin_left_menu.php'; ?>
            <!-- Content Panel -->
           
            <div class="grid_7">
                <div class="box">
                    <h2>
                        <a href="#" id="toggle-tables">CAR MODEL MANAGEMENT : <?= $this->management_model->get_make('CAR',$company_id)->make; ?></a>
                    </h2>
                    <div class="block" >
                        <form name="admin-form" action="<?= base_url(); ?>admin/management/car_model_insert" method="post">
                            <fieldset>
                                <legend>MODEL : NEW </legend>
                                <?php
                                if ($this->session->flashdata('message')) {
                                    $msg = $this->session->flashdata('message');
                                    echo '<font color="red">' . $msg . '</font>';
                                }
                                ?> 
                                <div class="field" style="float:left" >
                                    <label> Model Name</label>
                                    <input type="text" size="50" name="model" onfocus="if(this.value=='Enter Model')this.value='';" 
                                           onblur="if(this.value=='')this.value='Enter Model';" value="Enter Model"/>
                                    <input type="hidden" name="company_id" value="<?= $company_id; ?>" />

                                    <input type="submit" value="Add Model" name="insert" />
                                </div>
                                
                                <div style="float:right;">
                                    <?php $img=$this->management_model->get_make_image('CAR',$company_id); if($img!=''){ ?>
                                    <img style="border: 1px solid #CCC; padding: 3px" src="<?= base_url() ?>/images/car/company/<?= $img; ?>" height="75" width="188" align="center"/>
                                      <?php } ?>
                                </div>
                              
                            </fieldset>
                        </form>
                    </div>
                </div> <!-- END OF BOX -->
                <div class="box">
                    <h2>
                        <a href="#" id="toggle-tables">MODEL LIST : <?= $this->management_model->get_make('CAR',$company_id)->make; ?></a>
                    </h2>
                    <div class="block" >
                        <fieldset>
                            <legend>List :</legend>
                            <?php foreach ($model as $model): ?>
                                <div class="field">
                                    <form name="update_make" action="<?= base_url(); ?>admin/management/car_model_update" method="post"> 
                                        <input type="hidden" size="10" name="model_id" value="<?= $model->id; ?>" />
                                        <input type="hidden" size="10" name="make_id" value="<?= $model->make_id; ?>" />
                                        <input type="text" size="50" name="model_detail" value="<?= $model->model; ?>" />
                                        <input type="submit" value="Update" name="update_model" />
                                        <div id="link-button" style="float: right">
                                            <a href="<?= base_url(); ?>admin/management/car_model_delete/<?= $model->id; ?>/<?= $model->make_id; ?>" class="link-button" onclick="return confirm('Are you sure you ...')"> Delete </a>
                                            <a href="<?= base_url(); ?>admin/management/car_version/<?= $model->make_id; ?>/<?= $model->id; ?>" class="link-button"> View Version </a>
                                        </div>
                                    </form>
                                </div>
                            <?php endforeach; ?>
                        </fieldset>
                    </div>
                    <div class="pagination" align="left"> <?php echo $this->pagination->create_links(); ?>  </div>
                </div> <!-- END OF BOX -->
            </div>
            <div class="grid_16" id="site_info">
                <div class="box">
                    <p><?= $this->settings_model->get_setting('webtitle'); ?></p>
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <script type="text/javascript" src="<?= base_url(); ?>js/admin/mootools-1.2.1-core.js"></script>
        <script type="text/javascript" src="<?= base_url(); ?>js/admin/mootools-1.2-more.js"></script>
        <script type="text/javascript" src="<?= base_url(); ?>js/admin/mootools-fluid16-autoselect.js"></script>
    </body>
</html>